package org.example.SealedDemo;

/**
 * @Author zj@uinpay.cn
 * @Date 2024/8/19 11:06
 * sealed规定此类只支持permits指定的类进行继承
 */
public sealed abstract class PeopleAbstract implements PeopleLife permits ManPeopleLife {
    @Override
    public final void eat() {
        System.out.println("我们都吃饭");
        eatFood();
    }

    protected void eatFood() {
        System.out.println("吃蔬菜");
    }
}
